#!/bin/bash

tar -c logs/ | gzip - > logs.`date +%Y%m%d.%H%M`.tar.gz && rm logs/*

ERROR=`echo -e '\033[41m\033[37m'`
WARN=`echo -e '\E[31;40m'`
NORMAL=`echo -e '\033[0m'`
INFO=`echo -e '\033[1m'`

echo "$ERROR ERROR $NORMAL"
echo "$WARN WARN $NORMAL"
echo "$INFO INFO $NORMAL"
echo " NORMAL "
echo
sleep 1


java -jar ./dist/JThreadWatchDog.jar | sed -e "s/^.*WARN.*$/$WARN&$NORMAL/" -e "s/^.*INFO.*$/$INFO&$NORMAL/" -e "s/^.*ERROR.*$/$ERROR&$NORMAL/"
